package com.lstdemo.service.impl;

import com.lstdemo.dao.Userdao;
import com.lstdemo.domain.UserBean;
import com.lstdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {


    @Autowired
    private Userdao userdao;

    @Override
    public List<UserBean> transferMoney(String outname, String inname, int money) {
//        userdao.outMoney(outname, money);//余额减少
        userdao.inMoney(inname, money);//余额增加
        //查询所有
        List<UserBean> userBeans = userdao.selectAll();
        return userBeans;
    }
}
